/*
 * Amadeus Confidential Information:
 * Unauthorized use and disclosure strictly forbidden.
 * @1998-2007 - Amadeus s.a.s - All Rights Reserved.
 */
package com.amadeus.spin.devtool.soap.shooter.filter;

import com.amadeus.spin.devtool.soap.shooter.config.SoapShooterInitializationException;

public class FilterImpl implements Filter {

  protected static final String INT_TYPE = "int";

  protected static final String STRING_TYPE = "string";

  protected static final String DATE_TYPE = "date";

  private String m_filterName;

  private String m_filterValue;

  public FilterImpl(String p_filterName, String p_filterValue)
      throws SoapShooterInitializationException {
    if (p_filterName != null) {
      m_filterName = p_filterName;
      m_filterValue = p_filterValue;
    }
    else {
      throw (new SoapShooterInitializationException("Filter (null, " + p_filterValue + ") badly formed."));
    }
  }

  @Override
  public String getFilterName() {
    return m_filterName;
  }

  @Override
  public String getFormattedValue(String p_format) {
    return getDefaultValue();
  }

  @Override
  public String getDefaultValue() {
    return m_filterValue;
  }

  @Override
  public String getOriginalValue() {
    return m_filterValue;
  }

  @Override
  public String getTypeString() {
    return STRING_TYPE;
  }

}
